package com.swm.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class ClientController {

    @Autowired
    RestTemplate restTemplate;

    @RequestMapping("/client.do")
    public String invokeServer(){
        ResponseEntity<String> forEntity = restTemplate.getForEntity("http://localhost:1000/index", String.class);
        String body = forEntity.getBody();
        return body;
    }
}
